/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package datos;

/**
 *
 * @author miguesaca
 */
public class Factory implements FactoryMethod {

    @Override
    public AlarmaProducto crearAlarma(String alarma, Emergencie emergencie) {
        if (alarma.equalsIgnoreCase("Incendio")) {
            return new AlarmaIncendio(emergencie);
        }
        if (alarma.equalsIgnoreCase("Robo")) {
            return new AlarmaRobo(emergencie);
        }
        return null;
    }

}
